package medium电话号码组合;

import java.util.ArrayList;
import java.util.List;

public class Solution {

    public List<String> letterCombinations(String digits) {
        List<String> list = new ArrayList<>();
        if (digits.length() == 0)
            return list;

        String[] s = {"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
        String[] s1 = new String[4];
        int sum=1;
        char[] charArray = digits.toCharArray();
        int[] digitArry = new int[charArray.length];
        for (int i = 0; i < charArray.length; i++) {
            digitArry[i] = charArray[i]-'0';
        }
        for (int i = 0; i < digitArry.length; i++) {
            sum = sum*s[digitArry[i]].length();
            s1[i] = s[digitArry[i]];
        }
        String[] lt = new String[sum];

        if (s1.length == 1){
            for (int i = 0; i < s1[0].length(); i++) {
                list.add(s1[0].substring(i,i+1));
            }
            return list;
        }
        else
            for (int i = 0; i < s1.length; i++) {
                for (int j = 0; j < s1[i].length(); j++) {

                }
            }
        return list;
    }

}
